using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using  Domain.Entidades;

namespace Data.Models.Mapping
{
    public class aviso_setorMap : EntityTypeConfiguration<aviso_setor>
    {
        public aviso_setorMap()
        {
            // Primary Key
            this.HasKey(t => t.avset_codigo);

            // Properties
            // Table & Column Mappings
            this.ToTable("aviso_setor");
            this.Property(t => t.aviso_codigo).HasColumnName("aviso_codigo");
            this.Property(t => t.aviso_setor1).HasColumnName("aviso_setor");
            this.Property(t => t.avset_codigo).HasColumnName("avset_codigo");

            // Relationships
            this.HasRequired(t => t.aviso)
                .WithMany(t => t.aviso_setor)
                .HasForeignKey(d => d.aviso_codigo);
            this.HasRequired(t => t.setor)
                .WithMany(t => t.aviso_setor)
                .HasForeignKey(d => d.aviso_setor1);

        }
    }
}
